package com.SoftwareManage.service.impl;

import com.SoftwareManage.dao.PermissionDao;
import com.SoftwareManage.dao.RoleDao;
import com.SoftwareManage.entity.Permission;
import com.SoftwareManage.entity.Role;
import com.SoftwareManage.entity.RolePermission;
import com.SoftwareManage.service.PermissionService;
import com.SoftwareManage.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    private PermissionDao permissionDao;
    @Override
    public List<Permission> selectAll() {
        return permissionDao.selectAll();
    }

    @Override
    public List<Permission> selectAlls(int page, int pageSize) {
        return permissionDao.selectAlls(page, pageSize);
    }

    @Override
    public List<Permission> search(String permission_name) {
        return permissionDao.search(permission_name);
    }

    @Override
    public List<Permission> searchs(String permission_name, int page, int pageSize) {
        return permissionDao.searchs(permission_name, page, pageSize);
    }

    @Override
    public void update(int id, String permission, String permission_name, String remark) {
        permissionDao.update(id, permission, permission_name, remark);
    }

    @Override
    public List<String> selectAllPermissions() {
        return permissionDao.selectAllPermissions();
    }

    @Override
    public void addPermission(String permission, String permission_name, String remark) {
        permissionDao.addPermission(permission, permission_name, remark);
    }

    @Override
    public void deletePerm(int id) {
        permissionDao.deletePerm(id);
    }
}
